/************************************************************
* author: alexander.aivars <alexander.aivars&#64;svt.se>
* $Date:2007-12-19 11:39:12 +0100 (Wed, 19 Dec 2007) $
* $Revision:196 $
* $HeadURL:svn://stoiis03.internt.svt.se/SVTiFLASH/trunk/SVTSE/Source/Classes/se/svt/web/events/NetDataRequestEvent.as $
* $Id:NetDataRequestEvent.as 196 2007-12-19 10:39:12Z alai $
************************************************************/
package se.svt.web.events
{
	import flash.events.Event;
	
	import se.svt.web.models.NetData;

	public final class NetDataRequestEvent extends Event
	{

		private var _data:NetData;

		/**
		* The NetDataRequestEvent.COMPLETE constant defines the value of the 
		* <code>type</code> property of the event object 
		* for a <code>NetDataRequstComplete</code> event.
		*
		* @eventType NetDataRequstComplete
		*/
		public static const COMPLETE:String = "NetDataRequstComplete";

		/**
		* The NetDataRequestEvent.SUCCESS constant defines the value of the 
		* <code>type</code> property of the event object 
		* for a <code>NetDataRequstSuccess</code> event.
		*
		* @eventType NetDataRequstSuccess
		*/
		public static const SUCCESS:String = "NetDataRequstSuccess";

		/**
		* The NetDataRequestEvent.FAILED constant defines the value of the 
		* <code>type</code> property of the event object 
		* for a <code>NetDataRequstFailed</code> event.
		*
		* @eventType NetDataRequstFailed
		*/
		public static const FAILED:String = "NetDataRequstFailed";

		/**
		* The NetDataRequestEvent.ERROR constant defines the value of the 
		* <code>type</code> property of the event object 
		* for a <code>NetDataRequstError</code> event.
		*
		* @eventType NetDataRequstError
		*/
		public static const ERROR:String = "NetDataRequstError";
		
		/**
		 * 
		 * Creates an event object that contains information about net data request events.
		 * 
		 * @param type
		 * @param subtype
		 * @param bubbles
		 * @param cancelable
		 * 
		 */
		public function NetDataRequestEvent(type:String,data:NetData=null,bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			_data = data;
		}
		
		/**
		 * Returns a copy of the net data object.
		 * 
		 * @return 
		 * 
		 */		
		public function get data():NetData
		{
			return _data;	
		}
		
		/**
		 * Creates a copy of the NetDataRequestEvent object and sets the value of each property to match that of the original.
		 * 
		 * @return 
		 * 
		 */
		override public function clone():Event {
			return new NetDataRequestEvent(type,_data, bubbles, cancelable);
		}
	}
}